package top.jingles.tools.deploytool.entity;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

@Data
public class TaskList {
    List<Task> tasks;

    public TaskList() {
        tasks = new ArrayList<>();
    }

    public void addTask(Task task) {
        tasks.add(task);
    }

    public String toJSONString() {
        StringBuilder sb = new StringBuilder();
        sb.append("[");
        for (int i = 0; i < tasks.size(); i++) {
            if (i > 0) {
                sb.append(", ");
            }
            sb.append(tasks.get(i).toJSONString());
        }
        sb.append("]");
        return sb.toString();
    }
}
